package com.vecspace.dicttable;

import java.util.List;

import com.vecspace.web.servlet.model.HController;
import com.vecspace.web.servlet.model.Param;
import com.vecspace.web.servlet.model.Path;

/**
 * 
 * @version: 1.0
 * @author: wanghua
 */
@HController("dictHandler")
public class DictHandler {
	@Path("getItems")
	public List<CodeItem> getItems(@Param("codeType")String codeType){
		List<CodeItem> items = DictAll.getItems(codeType);
		return items;
	}
	@Path("getItems2")
	public List<CodeItem> getItems2(@Param("tableName")String tableName,
			@Param("codeField")String codeField,@Param("nameField")String nameField, @Param("orderByField")String orderByField){
		List<CodeItem> items = CodeDict.getInstance().getItems(tableName, codeField, nameField, null, orderByField);
		return items;
	}
	
	/**清空所有的代码缓存*/
	@Path("clear")
	public String clear(){
		DictAll.clear();
		CodeDict.getInstance().clear();
		return "OK:DictAll、DMDict memory cache cleared";
	}
}
